package com.itheima.基于反射操作构造方法;

import java.lang.reflect.Constructor;

public class Test {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException {
        Class clazz = Class.forName("com.itheima.基于反射操作构造方法.Student");
        Constructor[] constructors = clazz.getConstructors();
        for (Constructor constructor : constructors) {
            System.out.println(constructor);
        }

        System.out.println("---------------------------");
        Constructor[] declaredConstructors = clazz.getDeclaredConstructors();
        for (Constructor declaredConstructor : declaredConstructors) {
            System.out.println(declaredConstructor);
        }
        System.out.println("--------------------");
        Constructor constructor = clazz.getConstructor();
        System.out.println(constructor);
        System.out.println("---------------------------");
        Constructor declaredConstructor = clazz.getDeclaredConstructor(String.class, int.class);
        System.out.println(declaredConstructor);


    }
}
